package away3d.core.base ;



import away3d.entities.Entity ;

import flash.display3D.Context3D ;
import flash.display3D.IndexBuffer3D ;
import flash.display3D.VertexBuffer3D ;
import flash.geom.Matrix3D ;

/**
 * IRenderable provides an interface for objects that can be rendered in the rendering pipeline.
 */
public interface IRenderable extends IMaterialOwner
{
    /**
     * The transformation matrix that transforms from model to world space.
     */
    function get_sceneTransform() : Matrix3D<Float> ;
    
    /**
     * The inverse scene transform object that transforms from world to model space.
     */
    function get_inverseSceneTransform() : Matrix3D<Float> ;

    /**
     * The model-view-projection ( MVP ) matrix used to transform from model to homogeneous projection space.
     */
    function get_modelViewProjection() : Matrix3D<Float> ;

    /**
     * The distance of the IRenderable object to the view, used to sort per object.
     */
    function get_zIndex() : Float ;

    /**
     * Indicates whether the IRenderable should trigger mouse events, and hence should be rendered for hit testing.
     */
    function get_mouseEnabled() : Bool ;

    /**
     * Indicates whether the IRenderable needs to provide mouse event details, such as position and uv coordinates.
     */
    function get_mouseDetails() : Bool ;

    /**
     * Retrieves the VertexBuffer3D object that contains vertex positions.
     * @param context The Context3D for which we request the buffer
     * @return The VertexBuffer3D object that contains vertex positions.
     */
    function getVertexBuffer( context : Context3D, contextIndex : uint ) : VertexBuffer3D ;

    /**
     * Retrieves the VertexBuffer3D object that contains texture coordinates.
     * @param context The Context3D for which we request the buffer
     * @return The VertexBuffer3D object that contains texture coordinates.
     */
    function getUVBuffer( context : Context3D, contextIndex : uint ) : VertexBuffer3D ;

    /**
     * Retrieves the VertexBuffer3D object that contains vertex normals.
     * @param context The Context3D for which we request the buffer
     * @return The VertexBuffer3D object that contains vertex normals.
     */
    function getVertexNormalBuffer( context : Context3D, contextIndex : uint ) : VertexBuffer3D ;

    /**
     * Retrieves the VertexBuffer3D object that contains vertex tangents.
     * @param context The Context3D for which we request the buffer
     * @return The VertexBuffer3D object that contains vertex tangents.
     */
    function getVertexTangentBuffer( context : Context3D, contextIndex : uint ) : VertexBuffer3D ;

    /**
     * Retrieves the VertexBuffer3D object that contains triangle indices.
     * @param context The Context3D for which we request the buffer
     * @return The VertexBuffer3D object that contains triangle indices.
     */
    function getIndexBuffer( context : Context3D, contextIndex : uint ) : IndexBuffer3D ;

    /**
     * The amount of triangles that comprise the IRenderable geometry.
     */
    function get_numTriangles() : Int  ;

    /**
     * The entity that that initially provided the IRenderable to the render pipeline.
     */
    function get_sourceEntity() : Entity ;
    
    /**
     * Indicates whether the renderable can cast shadows
     */
    function get_castsShadows() : Bool ;
    
    
}